package com.asiainfo.eom.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.faker.project.constant.CommonStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 推广计划实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("ad_plan")
public class AdPlan {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("user_id") // 账户userId
    private Long userId;

    @TableField("plan_name") // 推广计划名称
    private String planName;

    @TableField("plan_status") // 推广计划状态
    private Integer planStatus;

    @TableField("start_date") // 推广计划开始时间
    private Date startDate;

    @TableField("end_date") // 推广计划结束时间
    private Date endDate;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    /**
     * 省略部分不重要信息的构造函数
     */
    public AdPlan(Long userId, String planName, Date startDate, Date endDate) {
        this.userId = userId;
        this.planName = planName;
        this.planStatus = CommonStatus.VALID.getStatus();
        this.startDate = startDate;
        this.endDate = endDate;
        this.createTime = new Date();
        this.updateTime = this.createTime;
    }
}
